/*
-----------------------------------------------------------------------------
This source file is part of Labor3D
(Labor 3D Graphics Engine)

Copyright (c) 2009-2020 Rock Mao
* creator : Rock Mao
* created : 2009-10-25   22:29
* filename: LaborRenderState.h
-----------------------------------------------------------------------------
*/

#ifndef __LABORRENDERSTATE_H__
#define __LABORRENDERSTATE_H__
#include "LaborCoreDef.h"
#include "LaborRenderSystemEnum.h"

NAMESPACE_LABOR3D_BEGIN

class LABORCORE_API  ILRenderState
{
protected:
	ILRenderState() { }
	virtual ~ILRenderState() {}
public:
	//virtual unsigned int  hash_name() = 0;
	virtual eLRenderStateType state_type() = 0;
	virtual bool              load(const wchar_t* fileName , unsigned long  arg) = 0;
	virtual bool              load(const wchar_t* fileName , const unsigned char* buf , size_t bufLen, unsigned long arg) = 0;
	virtual bool              isLoaded()  = 0;
	virtual bool              unload() = 0;
	virtual unsigned long     memUsage() = 0;


};

struct sLSamplerStateDesc 
{
public:
	eLTexFilter      m_eFilter;
	eLTexAddressMode m_eAddressU;
	eLTexAddressMode m_eAddressV;
	eLTexAddressMode m_eAddressW;
	float            m_fMinLOD;
	float            m_fMaxLOD;
	float            m_fMipLODBias;
	UINT             m_nMaxAnisotropy;
public:
	sLSamplerStateDesc()
	{
		m_eFilter        = eL_FILTER_MIN_MAG_MIP_LINEAR;
		m_eAddressU      = eL_TEXTURE_ADDRESS_WRAP;
		m_eAddressV      = eL_TEXTURE_ADDRESS_WRAP;
		m_eAddressW      = eL_TEXTURE_ADDRESS_WRAP;
		m_fMinLOD        = -3.402823466e+38F; /// min float 
		m_fMaxLOD        = 3.402823466e+38F;  /// max float 
		m_fMipLODBias    = 0;
		m_nMaxAnisotropy = 1;
	}
};
class LABORCORE_API  ILSamplerState : public ILRenderState
{
protected:
	ILSamplerState() {};
	virtual ~ILSamplerState(){};
public:
	eLRenderStateType state_type() {return eL_RenderState_Sampler ; }
	virtual bool create( const sLSamplerStateDesc & _desc ) = 0;

};

NAMESPACE_LABOR3D_END

#endif // __LABORRENDERSTATE_H__